from app.extension.database.sqlalchemy import sqla_db as db
from datetime import datetime
from .base_model import BaseModel


class CategoryModel(db.Model, BaseModel):
    """商品分类模型"""
    __tablename__ = 'tb_category'
    id = db.Column(db.Integer, primary_key=True)
    store_id = db.Column(db.Integer, comment='商铺id')
    store_name = db.Column(db.String(255), comment='商铺名')
    product_id = db.Column(db.Integer, comment='商品id')
    product_count = db.Column(db.Integer, comment='商品的数量')
    create_time = db.Column(db.DateTime, default=datetime.now)
    delete_time = db.Column(db.DateTime)